package com.qxp.simplerpc.entity;

import org.springframework.util.StringUtils;

public class CommonProperties {
    private String host;
    private int port;
    public CommonProperties(){}

    public CommonProperties(String host,int port){
        this.setHost(host);
        this.setPort(port);
    }

    public String getHost() {
        if(StringUtils.isEmpty(host))
            return "0.0.0.0";
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String toString() {
        return host + ":" + port;
    }
}
